import request from "@/common/Ask";
import type { Property } from "@/interface/Property";
import type { Page } from "@/interface/Page";
import type { Query } from "@/interface/Query"
import type {Select} from "@/interface/Select";

export async function operatorApi( data : Property) {
    return request<boolean>({
        url: 'properties/operator',
        method: 'put',
        data: data
    });
}

export async function listApi( data : Query ) {
    return request<Page<Property>>({
        url: 'properties/list',
        method: 'post',
        data: data
    });
}

export async function oneIdApi(data : string) {
    return request<Property>({
        url: 'properties/oneId/' + data,
        method: 'get',
    });
}

export async function deleteApi(data : string) {
    return request<Property>({
        url: 'properties/delete/' + data,
        method: 'delete',
    });
}

export async function bindSelectApi(data? : string) {
    return request<Select[]>({
        url: data ? 'properties/bindSelect/' + data : 'properties/bindSelect',
        method: 'get',
    });
}

